package com.hlhj.funlike_business.utils

import android.content.Context
import android.graphics.Bitmap
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.huantansheng.easyphotos.engine.ImageEngine

/**
 * Created by Never Fear   on 2018\9\27 0027.
Never More....
 */
class MyGlideEngin: ImageEngine {
    override fun getCacheBitmap(context: Context?, path: String?, width: Int, height: Int): Bitmap {
        return Glide.with(context!!).asBitmap().load(path).submit(width,height).get()
    }

    override fun loadGif(context: Context?, gifPath: String?, imageView: ImageView?) {
        Glide.with(context!!).asGif().load(gifPath).into(imageView!!)
    }

    override fun loadPhoto(context: Context?, photoPath: String?, imageView: ImageView?) {
        Glide.with(context!!).load(photoPath).into(imageView!!)

    }

    override fun loadGifAsBitmap(context: Context?, gifPath: String?, imageView: ImageView?) {
        Glide.with(context!!).asBitmap().load(gifPath).into(imageView!!)

    }
}